import axios from 'axios'
import Cookie from 'js-cookie'

const service = axios.create({
  baseURL:'http://localhost:9001',
  timeout: 20000
})

service.interceptors.request.use(
  config => {
    if(Cookie.get('guli_token')){
      config.headers['token'] = cookie.get('guli_token');
    }
    return config
  },
  err => {
    return Promise.reject(err)
  }
)
export default service